package com.longge.wechat.utils;

public class Map{
    
    public static String getLabel(String x,String y) {
    	XmlUtil xmlUtil = XmlUtil.getInstance();
        String ak = ReadProperties.loadProperties().getProperty("AK");
    	
    	/* 根据地理x，y坐标获取位置信息 */
        String locationUrl = "http://api.map.baidu.com/geocoder/v2/?"
        		+ "ak="+ak+"&callback=renderReverse&location="+x+","+y+"&output=xml&pois=0";
        
        xmlUtil.setURL(locationUrl);
        
        /*从url返回的xml文档中位置信息*/
        String str = xmlUtil.getContentByNodeName("formatted_address");
      
        return str;
       
    }
    
    public static void main(String[] args) {
    	System.out.println(getLabel("29.2609","120.248"));
	}
}
